from pathlib import Path
import os
from dotenv import load_dotenv

# 加载.env文件
load_dotenv()

# 基础路径配置
BASE_DIR = Path(__file__).resolve().parent.parent
STATIC_DIR = BASE_DIR / "frontend" / "static"
UPLOAD_DIR = BASE_DIR / "uploads"

# 服务器配置
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "8000"))

# 摄像头配置
MAX_CAMERAS = 8  # 最大扫描摄像头数量
CAMERA_SCAN_TIMEOUT = 1.0  # 摄像头扫描超时时间(秒)
FRAME_RATE = 30
FRAME_WIDTH = 640
FRAME_HEIGHT = 480

# AI模型配置
YOLO_MODEL = "yolov8n.pt"
CONFIDENCE_THRESHOLD = 0.5

# WebSocket配置
WS_PING_INTERVAL = 30  # 秒 